<template>
  <div class="tuan">
    <div class="dh">
      <div class="title">限时爆款 超级低价</div>
      <div class="box">
        <span>正在抢购</span>
        <span>上新预告</span>
      </div>
    </div>
    <div class="list">
      <div class="shop" v-for="(item, index) in shopArr" :key="index">
        <div class="tp">
          <img :src="item.picture" alt="" />
        </div>
        <div class="name">
          <p>{{ item.name }}</p>
        </div>
        <div class="spjs">
          <span>{{ item.month_saled_content }}</span>
        </div>
        <div class="price">
          <div>
            <span>￥{{ item.min_price }}</span>
          </div>
          <div class="msq">马上抢</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { tuan_list } from "../../utils/API";

export default {
  data() {
    return {
      shopArr: [],
    };
  },
  mounted() {
    tuan_list({ status: 1 }).then((res) => {
      // console.log(res.data);
      this.shopArr = res.data.list;
      // console.log(this.shopArr);
    });
  },
};
</script>

<style lang="scss" scoped>
.dh {
  padding: 10px;
  height: 160px;
  background: skyblue;
  position: relative;
}
.dh .title {
  height: 120px;
  line-height: 120px;
  text-align: center;
  font-size: 30px;
  color: orange;
}
.dh .box {
  position: absolute;
  bottom: 20px;
}
.dh .box span {
  margin-right: 10px;
  color: white;
  font-weight: bold;
}
.list {
  padding: 10px;
  background: #f5f5f5;
}
.list .shop {
  background: white;
  padding: 10px;
  margin: 10px 0;
  box-sizing: border-box;
  border-radius: 5px;
  height: 120px;
}
.list .shop .tp {
  float: left;
}
.list .shop .tp img {
  width: 100px;
  height: 100px;
  margin-right: 10px;
}
.list .shop .name p {
  font-weight: bolder;
}

.list .shop .spjs {
  font-size: 14px;
}
.list .shop .price {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: red;
}
.list .shop .price .msq {
  padding: 8px;
  background: red;
  color: white;
  border-radius: 20px;
  font-size: 14px;
}
</style>